package com.imooc.oauth2.server.mapper;

import com.imooc.commons.model.pojo.Diners;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 食客Mapper
 *
 * @author gcq
 * @Create 2022-10-08
 */
public interface DinersMapper {

    /**
     * 根据用户名 or 手机号 or 邮箱 查询用户信息
     *
     * @param account 用户账号
     * @return 结果
     */
    @Select("SELECT id , username, nickname, phone, email, password, avatar_url, roles, is_valid " +
            "from t_diners where (username = #{account} or phone = #{account} or email= #{account})")
    Diners selectByAccountInfo(@Param("account") String account);
}